---
layout: single
elementName: optgroup
---

<section id="optgroup" class="element">
  <header class="element-header">
    <nav class="element-links">
        <span>
          Type: <strong>block</strong>
        </span>
      <span>
        Self-closing:
        <strong>
            No
        </strong>
      </span>
      <a class="element-links-direct" href="{{site.url}}/element/optgroup/" data-element-name="optgroup" data-tooltip="Single page for this element">Permalink</a>
      <a class="element-share" data-tooltip="Share on Twitter or Facebook" data-element-name="optgroup">Share</a>
      <a target="_blank" href="https://developer.mozilla.org/en/docs/Web/HTML/Element/optgroup" data-tooltip="See on Mozilla Developer Network" rel="external">MDN</a>
    </nav>
    <h2 class="element-name">
      <a href="#optgroup">
        <span>#</span>
        optgroup
      </a>
    </h2>
    <div class="element-description">
      <p>Defines a <strong>group</strong> of <code>&lt;option&gt;</code> elements.</p>

    </div>
  </header>

      <div id="optgroup-example-0" class="example">
        <p class="example-label">
          <strong>Example:</strong>
          <a class="example-clipboard" data-tooltip="Click to copy code" data-clipboard-target="#optgroup-example-0-code">Copy</a>
        </p>
        <article class="example-preview">
            <div class="example-output"><select>
  <optgroup label="South America">
    <option>Uruguay</option>
    <option>Brazil</option>
    <option>Argentina</option>
  </optgroup>
  <optgroup label="Europe">
    <option>Italy</option>
    <option>Germany</option>
    <option>England</option>
    <option>France</option>
    <option>Spain</option>
  </optgroup>
</select></div>
          <div id="optgroup-example-0-code" class="example-code">{% highlight html %}<select>
  <optgroup label="South America">
    <option>Uruguay</option>
    <option>Brazil</option>
    <option>Argentina</option>
  </optgroup>
  <optgroup label="Europe">
    <option>Italy</option>
    <option>Germany</option>
    <option>England</option>
    <option>France</option>
    <option>Spain</option>
  </optgroup>
</select>{% endhighlight %}</div>
        </article>
      </div>
      <div id="optgroup-example-1" class="example">
        <p class="example-label">
          <strong>Example:</strong>
          <a class="example-clipboard" data-tooltip="Click to copy code" data-clipboard-target="#optgroup-example-1-code">Copy</a>
        </p>
        <article class="example-preview">
            <div class="example-output"><select>
  <optgroup label="Winter">
    <option>December</option>
    <option>January</option>
    <option>February</option>
    <option>March</option>
  </optgroup>
  <optgroup label="Not winter" disabled>
    <option>April</option>
    <option>May</option>
    <option>June</option>
    <option>July</option>
    <option>August</option>
    <option>September</option>
    <option>October</option>
    <option>November</option>
  </optgroup>
</select></div>
          <div id="optgroup-example-1-code" class="example-code">{% highlight html %}<select>
  <optgroup label="Winter">
    <option>December</option>
    <option>January</option>
    <option>February</option>
    <option>March</option>
  </optgroup>
  <optgroup label="Not winter" disabled>
    <option>April</option>
    <option>May</option>
    <option>June</option>
    <option>July</option>
    <option>August</option>
    <option>September</option>
    <option>October</option>
    <option>November</option>
  </optgroup>
</select>{% endhighlight %}</div>
        </article>
      </div>

    <article id="optgroup-label" class="attribute">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="label">
            label
          </code>
        </h3>
        <div class="attribute-description">
          <p>Defines the label for the whole group.</p>

        </div>
      </header>

      <div class="attribute-values">
          <article id="optgroup-label-south-america" class="value">
            <header class="value-header">
                <h4 class="value-name">
                  <code class="tag" data-tooltip="Click to copy label=&quot;South America&quot;" data-clipboard-text="label=&quot;South America&quot;">
                      "South America"
                  </code>
                </h4>
              <div class="value-description">
                <p>The label is not selectable.</p>

              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><select>
  <optgroup label="South America">
    <option>Uruguay</option>
    <option>Brazil</option>
    <option>Argentina</option>
  </optgroup>
  <optgroup label="Europe">
    <option>Italy</option>
    <option>Germany</option>
    <option>England</option>
    <option>France</option>
    <option>Spain</option>
  </optgroup>
</select></div>
            </aside>
          </article>
      </div>
    </article>
    <article id="optgroup-disabled" class="attribute attribute--novalue">
      <header class="attribute-header">
        <h3 class="attribute-name">
          <code class="tag" data-tooltip="Click to copy" data-clipboard-text="disabled">
            disabled
          </code>
        </h3>
        <div class="attribute-description">
          <p>Disables all the options of the group.</p>

            <strong class="attribute-is-novalue">No value required.</strong>
        </div>
      </header>

      <div class="attribute-values">
          <article id="optgroup-disabled-undefined" class="value">
            <header class="value-header">
              <div class="value-description">
                
              </div>
            </header>
            <aside class="value-preview">
              <div class="value-output"><optgroup  disabled></optgroup></div>
            </aside>
          </article>
      </div>
    </article>
</section>
